#pragma once

#define GET_CLASS_OFFSET(deriveClass, baseClass) \
    (size_t(static_cast<baseClass*>(reinterpret_cast<deriveClass*>(0x10000000))) - 0x10000000)

#define BEGIN_WINDOW_PART(localClass, baseClass)\
    class X##localClass : public baseClass\
    {\
    public:

#define END_WINDOW_PART(localClass)\
    } m_x##localClass;\
    friend class X##localClass;\

#define METHOD_PROLOGUE(theClass, localClass) \
    theClass* pThis = \
    ((theClass*)((BYTE*)this - offsetof(theClass, m_x##localClass))); \
    pThis; 

#define BEGIN_WINDOW_PART2(localClass, baseClass)\
    class localClass : public baseClass\
    {\
    public:

#define END_WINDOW_PART2(localClass, memName)\
    } memName;\
    friend class localClass;\

#define METHOD_PROLOGUE2(theClass, memName) \
    theClass* pThis = \
    ((theClass*)((BYTE*)this - offsetof(theClass, memName))); \
    pThis; 
